package net.dodoman.dynamicproxy;

import java.lang.reflect.Proxy;

public class ProxyMain {

	public static void main(String args[]) {
		IProxy realObj = new IProxyImpl();
		ProxyHandler proxyHandler = new ProxyHandler(realObj);
		// IProxy myDelegate = (IProxy) proxyHandler.bind(realObj);
		IProxy myDelegate = (IProxy) Proxy.newProxyInstance(realObj.getClass()
				.getClassLoader(), realObj.getClass().getInterfaces(),
				proxyHandler);
		myDelegate.action();
	}

}
